import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/Home'
import Classify from '@/pages/classify/Classify'
import Search from '@/pages/search/Search'
import Question from '@/pages/qa/Question'
import Detail from '@/pages/detail/Detail'
import My from '@/pages/my/My'
import ClassifyDetail from '@/pages/classifyDetail/ClassifyDetail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    }, {
      path: '/classify',
      name: 'Classify',
      component: Classify
    }, {
      path: '/search',
      name: 'Search',
      component: Search
    }, {
      path: '/search/match',
      name: 'Search',
      component: Search
    }, {
      path: '/question',
      name: 'Question',
      component: Question
    }, {
      path: '/my',
      name: 'My',
      component: My
    }, {
      path: '/detail',
      name: 'Detail',
      component: Detail
    }, {
      path: '/course/1',
      name: 'ClassifyDetail',
      component: ClassifyDetail
    }, {
      path: '/lecture/1',
      name: 'ClassifyDetail',
      component: ClassifyDetail
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
